package com.cloud.common.entity.po;

import com.cloud.common.entity.vo.PaginationVO;

import java.util.ArrayList;

/**
 * 响应分页结果的统一格式
 */
public class PaginationResult<T> extends Result<PaginationVO<T>> {

    public static <T> PaginationResult<T> success(long total, ArrayList<T> response) {
        PaginationResult<T> paginationResult = new PaginationResult<T>();
        paginationResult.setCode(1);
        paginationResult.setMessage("success");
        paginationResult.setData(new PaginationVO<>(total, response));
        return paginationResult;
    }

}
